package main.java.file;

import java.io.File;

public class ListFilesDemo {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            File[] files = dir.listFiles();
            for(File subs : files){
                System.out.println((subs.isFile()?"文件:":"目录:")+subs.getName());
            }
        }
    }
}
